# _*_ coding:utf-8 _*_
from django.db import models

class patient(models.Model):
    patient_name=models.CharField(max_length=50)
    patient_age=models.PositiveIntegerField ()
    patient_birthdate=models.DateField()
    patient_company=models.CharField(max_length=100,blank=True,null=True)
    patient_home=models.CharField(max_length=100,blank=True,null=True)
    patient_tel=models.CharField(max_length=13,blank=True,null=True)
    patient_card=models.PositiveIntegerField (blank=True,null=True)
    patient_native=models.CharField(max_length=20,blank=True,null=True)
    patient_inputdate=models.DateField()
    patient_number=models.PositiveIntegerField(unique=True)
    patient_remark=models.TextField(max_length=200,blank=True,null=True)
    patient_gender=models.CharField(max_length=4)
    

class PatientNo(models.Model):
    Patient_no=models.CharField(max_length=30)
    patient=models.ForeignKey(patient)
    
    
class hospitalized(models.Model):
    hospitalized_no=models.CharField(max_length=30)
    patient=models.ForeignKey(patient)
    
    
class Incentive(models.Model):
    Infection = models.CharField(max_length=300,blank=True,null=True) #诱因
    Pregnancy = models.CharField(max_length=300,blank=True,null=True) #妊娠
    Drugs = models.CharField(max_length=300,blank=True,null=True) #药物
    Tired = models.CharField(max_length=300,blank=True,null=True)#劳累
    Psychogenic = models.CharField(max_length=300,blank=True,null=True)#精神因素
    Fitment = models.CharField(max_length=300,blank=True,null=True)#装修
    Menopause = models.CharField(max_length=300,blank=True,null=True)#绝经
    Others = models.CharField(max_length=300,blank=True,null=True)#其他
    Patient = models.ForeignKey(patient)#患者
    
    
    
class Manifestation(models.Model):
    Initial = models.CharField(max_length=600,blank=True,null=True)
    Skin = models.CharField(max_length=600,blank=True,null=True)
    Joint = models.CharField(max_length=600,blank=True,null=True)
    Muscle = models.CharField(max_length=600,blank=True,null=True)
    Respiratory = models.CharField(max_length=600,blank=True,null=True)
    Cardiovascular = models.CharField(max_length=600,blank=True,null=True)
    Raynaud = models.CharField(max_length=600,blank=True,null=True)
    Digestive = models.CharField(max_length=600,blank=True,null=True)
    Hemotologic = models.CharField(max_length=600,blank=True,null=True)
    Urinary = models.CharField(max_length=600,blank=True,null=True)
    Nervous = models.CharField(max_length=600,blank=True,null=True)
    Menstruation = models.CharField(max_length=600,blank=True,null=True)
    Patient = models.ForeignKey(patient) #患者
    
    
class Course(models.Model):
    Course = models.CharField(max_length=3000,blank=True,null=True)
    Patient = models.ForeignKey(patient) #患者
    
    
class History(models.Model):
    Past = models.CharField(max_length=3000,blank=True,null=True)
    Family = models.CharField(max_length=3000,blank=True,null=True)
    Birth = models.CharField(max_length=3000,blank=True,null=True)
    Pregnancy = models.CharField(max_length=3000,blank=True,null=True)
    Birthtime = models.CharField(max_length=30,blank=True,null=True)
    Abortion = models.CharField(max_length=30,blank=True,null=True)
    Living = models.CharField(max_length=30,blank=True,null=True)
    Fs = models.CharField(max_length=30,blank=True,null=True)
    Ms = models.CharField(max_length=30,blank=True,null=True)
    Patient = models.ForeignKey(patient) #患者
       
class Physical(models.Model):
    Lung = models.CharField(max_length=3000,blank=True,null=True)
    Heart = models.CharField(max_length=3000,blank=True,null=True)
    Liver = models.CharField(max_length=3000,blank=True,null=True)
    Spleen = models.CharField(max_length=3000,blank=True,null=True)
    Hair = models.CharField(max_length=3000,blank=True,null=True)
    Skin2 = models.CharField(max_length=3000,blank=True,null=True)
    Edema = models.CharField(max_length=3000,blank=True,null=True)
    Joint = models.CharField(max_length=3000,blank=True,null=True)
    Muscle2 = models.CharField(max_length=3000,blank=True,null=True)
    Vasculitis = models.CharField(max_length=3000,blank=True,null=True)
    Lymph = models.CharField(max_length=3000,blank=True,null=True)
    Nervous2 = models.CharField(max_length=3000,blank=True,null=True)
    Patient = models.ForeignKey(patient) #患者
    
    
class Standard(models.Model):
    optionsRadios1 = models.CharField(max_length=1)
    optionsRadios2 = models.CharField(max_length=1)
    optionsRadios3 = models.CharField(max_length=1)
    optionsRadios4 = models.CharField(max_length=1)
    optionsRadios5 = models.CharField(max_length=1)
    optionsRadios6 = models.CharField(max_length=1)
    optionsRadios7 = models.CharField(max_length=1)
    optionsRadios8 = models.CharField(max_length=1)
    optionsRadios9 = models.CharField(max_length=1)
    optionsRadios10 = models.CharField(max_length=1)
    optionsRadios11 = models.CharField(max_length=1)
    optionsRadios12 = models.CharField(max_length=1)
    optionsRadios13 = models.CharField(max_length=1)
    optionsRadios14 = models.CharField(max_length=1)
    optionsRadios15 = models.CharField(max_length=1)
    optionsRadios16 = models.CharField(max_length=1)
    optionsRadios17 = models.CharField(max_length=1)
    Patient = models.ForeignKey(patient) #患者
    
    
class Follow(models.Model):
    ssddi = models.IntegerField()
    ssdi = models.IntegerField()
    essdai = models.IntegerField()
    sf12_pcs = models.IntegerField()
    sf12_mcs = models.IntegerField()
    esspri = models.CharField(max_length=300)
    pcm = models.CharField(max_length=300,blank=True,null=True)
    tongue = models.CharField(max_length=300,blank=True,null=True)
    other = models.CharField(max_length=300,blank=True,null=True)
    inputdate=models.DateField()
    Patient = models.ForeignKey(patient) #患者
    
    
class Labfindings(models.Model):
    inputdate=models.DateField(blank=True,null=True)
    Patient = models.ForeignKey(patient)
    Follow = models.ForeignKey(Follow)
    ANA = models.CharField(max_length=550,blank=True,null=True)
    anti_ENA_Ab = models.CharField(max_length=550,blank=True,null=True)
    SSA = models.CharField(max_length=550,blank=True,null=True)
    SSB = models.CharField(max_length=550,blank=True,null=True)
    RNP = models.CharField(max_length=550,blank=True,null=True)
    Jo = models.CharField(max_length=550,blank=True,null=True)
    Scl = models.CharField(max_length=550,blank=True,null=True)
    dsDNA = models.CharField(max_length=550,blank=True,null=True)
    MPO = models.CharField(max_length=550,blank=True,null=True)
    PR3 = models.CharField(max_length=550,blank=True,null=True)
    anti_CCP_Ab = models.CharField(max_length=550,blank=True,null=True)
    anticardiolipin = models.CharField(max_length=550,blank=True,null=True)
    RF = models.CharField(max_length=550,blank=True,null=True)
    serum = models.CharField(max_length=550,blank=True,null=True)
    IgM = models.CharField(max_length=550,blank=True,null=True)
    IgA = models.CharField(max_length=550,blank=True,null=True)
    C3 = models.CharField(max_length=550,blank=True,null=True)
    C4 = models.CharField(max_length=550,blank=True,null=True)
    CH50 = models.CharField(max_length=550,blank=True,null=True)
    SS = models.CharField(max_length=550,blank=True,null=True)
    hormone = models.CharField(max_length=550,blank=True,null=True)
    CTX = models.CharField(max_length=550,blank=True,null=True)
    MTX = models.CharField(max_length=550,blank=True,null=True)
    Aza = models.CharField(max_length=550,blank=True,null=True)
    CQ = models.CharField(max_length=550,blank=True,null=True)
    reaction = models.CharField(max_length=550,blank=True,null=True)
    other = models.CharField(max_length=550,blank=True,null=True)
    X_ray = models.CharField(max_length=550,blank=True,null=True)
    CTScan = models.CharField(max_length=550,blank=True,null=True)
    ECG  = models.CharField(max_length=550,blank=True,null=True)
    UCG  = models.CharField(max_length=550,blank=True,null=True)
    Pulmonary = models.CharField(max_length=550,blank=True,null=True)
    EEG = models.CharField(max_length=550,blank=True,null=True)
    ultrasonagraphy  = models.CharField(max_length=550,blank=True,null=True)
    EMG = models.CharField(max_length=550,blank=True,null=True)
    Labial = models.CharField(max_length=550,blank=True,null=True)
    pathologyNO1 = models.CharField(max_length=550,blank=True,null=True)
    date1 = models.CharField(max_length=550,blank=True,null=True)
    Renal = models.CharField(max_length=550,blank=True,null=True)
    pathologyNO2 = models.CharField(max_length=550,blank=True,null=True)
    date2 = models.CharField(max_length=550,blank=True,null=True)
    Bone = models.CharField(max_length=550,blank=True,null=True)
    pathologyNO3 = models.CharField(max_length=550,blank=True,null=True)
    date3 = models.CharField(max_length=550,blank=True,null=True)
    
    
class ESSDAI_model(models.Model):
    RadioGroup1 = models.CharField(max_length=1)
    RadioGroup2 = models.CharField(max_length=1)
    RadioGroup3 = models.CharField(max_length=1)
    RadioGroup4 = models.CharField(max_length=1)
    RadioGroup5 = models.CharField(max_length=1)
    RadioGroup6 = models.CharField(max_length=1)
    RadioGroup7 = models.CharField(max_length=1)
    RadioGroup8 = models.CharField(max_length=1)
    RadioGroup9 = models.CharField(max_length=1)
    RadioGroup10 = models.CharField(max_length=1)
    RadioGroup11 = models.CharField(max_length=1)
    RadioGroup12 = models.CharField(max_length=1)
    follow = models.ForeignKey(Follow, blank=True, null=True)
    
class SSDI_model(models.Model):
    RadioGroup1 = models.CharField(max_length=1)
    RadioGroup2 = models.CharField(max_length=1)
    RadioGroup3 = models.CharField(max_length=1)
    RadioGroup4 = models.CharField(max_length=1)
    RadioGroup5 = models.CharField(max_length=1)
    RadioGroup6 = models.CharField(max_length=1)
    RadioGroup7 = models.CharField(max_length=1)
    RadioGroup8 = models.CharField(max_length=1)
    RadioGroup9 = models.CharField(max_length=1)
    text_R = models.CharField(max_length=200,blank=True,null=True)
    text_L = models.CharField(max_length=200,blank=True,null=True)
    text_12 = models.CharField(max_length=200,blank=True,null=True)
    RadioGroup13 = models.CharField(max_length=1)
    RadioGroup14 = models.CharField(max_length=1)
    RadioGroup15 = models.CharField(max_length=1)
    RadioGroup16 = models.CharField(max_length=1)
    RadioGroup17 = models.CharField(max_length=1)
    RadioGroup18 = models.CharField(max_length=1)
    RadioGroup19 = models.CharField(max_length=1)
    RadioGroup20 = models.CharField(max_length=1)
    RadioGroup21 = models.CharField(max_length=1)
    RadioGroup22 = models.CharField(max_length=1)
    RadioGroup23 = models.CharField(max_length=1)
    RadioGroup24 = models.CharField(max_length=1)
    RadioGroup25 = models.CharField(max_length=1)
    RadioGroup26 = models.CharField(max_length=1)
    RadioGroup27 = models.CharField(max_length=1)
    RadioGroup28 = models.CharField(max_length=1)
    RadioGroup29 = models.CharField(max_length=1)
    RadioGroup30 = models.CharField(max_length=1)
    RadioGroup31 = models.CharField(max_length=1)
    RadioGroup32 = models.CharField(max_length=1)
    RadioGroup33 = models.CharField(max_length=1)
    RadioGroup34 = models.CharField(max_length=1)
    RadioGroup35 = models.CharField(max_length=1)
    RadioGroup36 = models.CharField(max_length=1)
    RadioGroup37 = models.CharField(max_length=1)
    RadioGroup38 = models.CharField(max_length=1)
    RadioGroup39 = models.CharField(max_length=1)
    RadioGroup40 = models.CharField(max_length=1)
    DD = models.CharField(max_length=200,blank=True,null=True) #滴度
    ZCFW_DD = models.CharField(max_length=200,blank=True,null=True) #正常范围
    T4 = models.CharField(max_length=200,blank=True,null=True)
    ZCFW_T4 = models.CharField(max_length=200,blank=True,null=True)
    TSH = models.CharField(max_length=200,blank=True,null=True)
    ZCFW_TSH = models.CharField(max_length=200,blank=True,null=True)
    follow = models.ForeignKey(Follow, blank=True, null=True)
    
    
class SSDDI_model(models.Model):
    checkbox1 = models.CharField(max_length=3,blank=True,null=True)
    checkbox2 = models.CharField(max_length=3,blank=True,null=True)
    checkbox3 = models.CharField(max_length=3,blank=True,null=True)
    checkbox4 = models.CharField(max_length=3,blank=True,null=True)
    checkbox5 = models.CharField(max_length=3,blank=True,null=True)
    checkbox6 = models.CharField(max_length=3,blank=True,null=True)
    checkbox7 = models.CharField(max_length=3,blank=True,null=True)
    checkbox8 = models.CharField(max_length=3,blank=True,null=True)
    checkbox9 = models.CharField(max_length=3,blank=True,null=True)
    checkbox10 = models.CharField(max_length=3,blank=True,null=True)
    checkbox11 = models.CharField(max_length=3,blank=True,null=True)
    checkbox12 = models.CharField(max_length=3,blank=True,null=True)
    checkbox13 = models.CharField(max_length=3,blank=True,null=True)
    checkbox14 = models.CharField(max_length=3,blank=True,null=True)
    checkbox15 = models.CharField(max_length=3,blank=True,null=True)
    follow = models.ForeignKey(Follow, blank=True, null=True)
    

    
    
    
    
    
    
    
    
    